package top.lemna.account.domain;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class CreditEnterAccountCommandHandler {
    @Autowired
    private AccountRepository repository;

    public void handle(EventQueue eventQueue,CreditEnterAccountCommand command) {
        Account account = repository.find(command.getAccountId());
        account.handle(eventQueue, command);
        repository.save(account);
    }
}
